<!DOCTYPE html>
<html lang="cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>let 变量</title>
</head>

<body>
    陆梓峰 24510206097
</body>

</html>
<script>
    let yourName;

    yourName = prompt("请输入你的名字");

    // alert(yourName);
    document.write(yourName);

    let num1 = 10;
    let num2 = 20;
    let swap;

    function JiaoHuan() {
        document.write("num1:" + num1 + "num2:" + num2); //输出num1,num2的初始值
        swap = num1;
        num1 = num2;
        num2 = swap;
        document.write("交换后num1:" + num1 + "交换后num2:" + num2); //输出num1,num2交换后的值

    }
    JiaoHuan();
</script>